package cn.SiFuLan.controls;

import cn.SiFuLan.dao.IbrandDao;
import cn.SiFuLan.dao.impl.brandDaoImpl;
import cn.SiFuLan.entity.brandEntity;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet(urlPatterns = "/admin/bupdate3.do")
public class adadadaad extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");

        IbrandDao ibrandDao=new brandDaoImpl();
        brandEntity brand=new brandEntity();
        String uname=request.getParameter("uname");
        brand.setBrand_Name(uname);
        String name=request.getParameter("name");
        brand.setInitial(name);
        List<brandEntity> list =ibrandDao.getAll(brand);
        request.setAttribute("list",list);
        request.getRequestDispatcher("Bupdate.jsp").forward(request,response);
    }
}
